home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DSIIC2.ARJ / L_SCRN3.C < prev    next >
C/C++ Source or Header  |  1991-07-15  |  2KB  |  92 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   L_SCRN3.C    ***************************/
  4.  
  5. #include "mydef.h"
  6. #include <dos.h>
  7.  
  8.  
  9. /*****************************************************************
  10.  
  11.  Usage: int cursor(int size);
  12.  
  13.  Sets the size of the cursor.
  14.  
  15.  Uses the following definitions found in "mydef.h":
  16.  
  17.  BIG_CURSOR    = 2     Full-sized cursor.
  18.  NORMAL_CURSOR = 1     Normal underline cursor.
  19.  NO_CURSOR     = 0     Cursor invisible.
  20.  
  21. *****************************************************************/
  22.  
  23. void cursor(int size)
  24. {
  25. extern struct screen_structure scr;
  26. int start,end;
  27.  
  28.     /* set cursor for color graphic type cards */
  29.  
  30.     if (scr.mode == COLOR_80 || scr.mode == BW_80){
  31.         if (size == NO_CURSOR){
  32.             start=16; end=0;
  33.         }
  34.         if (size == NORMAL_CURSOR){
  35.             start=6; end=7;
  36.         }
  37.         if (size == BIG_CURSOR){
  38.             start=0,end=7;
  39.         }
  40.     }
  41.  
  42.     /* set cursor for monochrome cards */
  43.  
  44.     if (scr.mode == MONOCHROME ){
  45.         if (size == NO_CURSOR){
  46.             start=16;end=0;
  47.         }
  48.         if (size == NORMAL_CURSOR){
  49.             start=11;end = 12;
  50.         }
  51.        if (size == BIG_CURSOR){
  52.             start=0;end =14;
  53.        }
  54.     }
  55.  
  56.    set_cursor(start,end);
  57. }
  58.  
  59.  
  60. /*****************************************************************
  61.  
  62.  Usage: void set_cursor(int start, int end);
  63.  
  64.  Sets the size of the cursor based on start and end scan lines.
  65.  
  66.  Gives more control that cursor(size);
  67.  
  68. *****************************************************************/
  69.  
  70. void set_cursor (int start, int end)
  71. {
  72. extern struct screen_structure scr;
  73. extern struct window_structure w[];
  74.  
  75.  union REGS regs;
  76.  
  77.  if(scr.update==TRUE){  /* if update ok then set cursor */
  78.  
  79.   regs.h.ah=0x01;       /* set cursor function */
  80.  
  81.   regs.h.ch=start;      /* starting line in ch */
  82.   regs.h.cl=end;        /* ending line in cl   */
  83.  
  84.   int86(0x10,®s,®s);   /* do interrupt */
  85.  }
  86.  
  87. /* save cursor information */
  88. w[scr.active].start=start;
  89. w[scr.active].end=end;
  90.  
  91. }
  92.